package com.bustle.user.dto.address;

import javax.ejb.EJB;
import javax.ejb.Local;
import javax.ejb.Stateless;

import com.bustle.commons.MapConverter;
import com.bustle.commons.data.dao.Dao;
import com.bustle.commons.data.dto.DtoDao;
import com.bustle.user.data.Address;
import com.bustle.user.data.dao.AddressDao;

@Local
public interface AddressDtoDao extends Dao<Integer, AddressDto>
{
  @Stateless
  public class DefaultAddressDtoDao extends DtoDao<Integer, AddressDto, Address> implements AddressDtoDao
  {
    @Override
    protected Dao<Integer, Address> getDao()
    {
      return dao;
    }

    @Override
    protected MapConverter<AddressDto, Address> getDtoToDataMapConverter()
    {
      return dtoToAddressConverter;
    }

    @Override
    protected MapConverter<Address, AddressDto> getDataToDtoMapConverter()
    {
      return addressToDtoConverter;
    }

    @EJB
    protected AddressDao dao;
    @EJB
    protected DtoToAddressMapConverter dtoToAddressConverter;
    @EJB
    protected AddressToDtoMapConverter addressToDtoConverter;
  }
}
